<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.40/vue.global.js"></script>
</head>
<body>
    <div class="app">
        <input @keydown.enter = "change" v-model="name" placeholder="输入">
        <input type="text" name="" id="" class="ipt">
        <div class="ap"></div>
    </div>
</body>
</html>
<script>
    const asd = document.querySelector('.ap')
    const ipt = document.querySelector('.ipt')
    const { createApp } = Vue
    const app = createApp({
        data(){
            return{
                name:''
            }
        },
        methods:{
            change(e){
                asd.innerText= ipt.value
                console.log('123');
           }
        }
    })
    app.mount('.app')
</script>